package com.example.lenovo.listview_lxy;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.widget.ListView;

import com.example.lenovo.listview_lxy.adapter.mainAdapter;
import com.example.lenovo.listview_lxy.bean.RefreshData;

import java.util.ArrayList;
import java.util.List;

public class MainActivity extends AppCompatActivity {

    private ListView mLv_listview;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        initView();
        initListener();
        initData();
    }

    private void initData() {
        List<RefreshData> listdata=new ArrayList<RefreshData>();
        for(int x=0;x<20;x++)
        {
            RefreshData cd=new RefreshData();
//                            cd.setHead_img("nick_name"+x);
            cd.setPhone("155"+x);
            cd.setNick_name("nick_name"+x);
            cd.setSex(x);
            listdata.add(cd);
        }
        mLv_listview.setAdapter(new mainAdapter(this,listdata));
    }

    private void initView() {
        mLv_listview = (ListView) findViewById(R.id.lv_listview);
    }

    private void initListener() {

    }
}
